package net.fltx.taskmgr.win32api;

import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

/**
 * Windows api位图结构体,大小24个字节
 */
public class Bitmap extends Structure {
    public static class ByRef extends Bitmap implements Structure.ByReference{}
    public int bmType; //位图类型，必须为0
    public int bmWidth; //位图宽度
    public int bmHeight; //位图高度
    public int bmWidthBytes; //每一行像素所需的byte数
    public char bmPlanes; //颜色平面数
    public char bmBitsPixel; //像素的位数
    public int bmBits; //位图内存指针

    @Override
    public List<String> getFieldOrder(){
        return Arrays.asList(new String[]{"bmType","bmWidth","bmHeight","bmWidthBytes","bmPlanes","bmBitsPixel","bmBits"});
    }

    @Override
    public String toString() {
        return "Bitmap{" +
                "bmType=" + bmType +
                ", bmWidth=" + bmWidth +
                ", bmHeight=" + bmHeight +
                ", bmWidthBytes=" + bmWidthBytes +
                ", bmPlanes=" + bmPlanes +
                ", bmBitsPixel=" + bmBitsPixel +
                ", bmBits=" + bmBits +
                '}';
    }
}
